package com.power.flowable.model;


import com.plf.core.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
*  流程表单环节配置实体类
*/

@Entity
@ApiModel(value="流程表单环节配置")
@Data
@Table(name="Act_dsn_form_step")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(Act_dsn_form_step.Act_dsn_form_stepPK.class) 用于复合组件
public class Act_dsn_form_step extends BaseModel implements Serializable {

	private static final long serialVersionUID = 1L;

    @Id
    @Setter(AccessLevel.NONE)
    private String id;

    @ApiModelProperty(value = "引用表单id")
    private String formid_;

    @ApiModelProperty(value = "环节id")
    private String stepid_;

    @ApiModelProperty(value = "配置的字段数量")
    private Integer fieldnum_;

    @ApiModelProperty(value = "配置状态")
    private Integer status_;

    // 自定义属性, 环节名称
    @Transient
    private String name;

    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("formid_", this.getFormid_());
        map.put("stepid_", this.getStepid_());
        map.put("fieldnum_", this.getFieldnum_());
        map.put("status_", this.getStatus_());
        return map;
    }

    public String getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (String) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new Act_dsn_form_stepPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (String)key;

        //Act_dsn_form_stepPK pk = (Act_dsn_form_stepPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}
